package com.dana.system.controller.user;

import com.core.controller.BaseController;

import com.core.domain.Result;
import com.core.domain.TableDataInfo;
import com.dana.system.domain.user.dto.QueryUserDTO;
import com.dana.system.domain.user.dto.UpdateUserStatusDTO;
import com.dana.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Autowired
    private IUserService userService;
    /**
     * 获取用户列表
     */
    @GetMapping("/list")
    public TableDataInfo list(QueryUserDTO queryUserDTO){
        return getTableDataInfo(userService.getList(queryUserDTO));
    }
    /**
     * 更新用户的状态信息
     */
    @PutMapping("/updateStatus")
    public Result<Void> updateStatus(UpdateUserStatusDTO updateUserStatusDTO){
        //TODO 拉黑:禁止用户操作 解禁:接触用户操作限制
        return toResult(userService.updateStatus(updateUserStatusDTO));
    }
}
